/*export function minL() {
  return 5
}
export function maxL() {
  return 60
}*/

export function nameMaxLength() {
  return [30, '字符长度不能超过30'];
}
export function nameMinLength() {
  return [2, '字符长度不能小于2'];
}

export function remarkMaxLength() {
  return [140, '字符长度不能超过140'];
}

export function contentLength() {
  return [750, '字符长度不能超过750'];
}

export function regLength() {
  return [2000, '字符长度不能超过2000'];
}

export function ruleP(n) {
  let ruleA = [];
  switch (n) {
    case 0:
      ruleA = ['^\\w+$', '不能输入中文等特殊字符'];
      break;
    case 1:
      ruleA = ['^[^\u4e00-\u9fa5]{0,}$', '不能输入中文'];
      break;
    case 2:
      ruleA = ['^[1-9]\\d*$', '请输入正确的数值'];
      break;
      case 3:
        ruleA = [
          '^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^([\\da-fA-F]{1,4}:){6}((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^::([\\da-fA-F]{1,4}:){0,4}((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^([\\da-fA-F]{1,4}:):([\\da-fA-F]{1,4}:){0,3}((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^([\\da-fA-F]{1,4}:){2}:([\\da-fA-F]{1,4}:){0,2}((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^([\\da-fA-F]{1,4}:){3}:([\\da-fA-F]{1,4}:){0,1}((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^([\\da-fA-F]{1,4}:){4}:((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|^([\\da-fA-F]{1,4}:){7}[\\da-fA-F]{1,4}$|^:((:[\\da-fA-F]{1,4}){1,6}|:)$|^[\\da-fA-F]{1,4}:((:[\\da-fA-F]{1,4}){1,5}|:)$|^([\\da-fA-F]{1,4}:){2}((:[\\da-fA-F]{1,4}){1,4}|:)$|^([\\da-fA-F]{1,4}:){3}((:[\\da-fA-F]{1,4}){1,3}|:)$|^([\\da-fA-F]{1,4}:){4}((:[\\da-fA-F]{1,4}){1,2}|:)$|^([\\da-fA-F]{1,4}:){5}:([\\da-fA-F]{1,4})?$|^([\\da-fA-F]{1,4}:){6}:$',
          '请输入正确的IP地址',
        ];
        break;
    case 4:
      ruleA = [
        '^(?=[\\\\0-9a-zA-Z\u4e00-\u9fa5+_-]+$)',
        '只能输入中英文、数字、下划线、加号、减号、反斜杠',
      ];
      break;
    case 5:
      ruleA = ['^[a-zA-Z\u4e00-\u9fa5\\d.]+$', '只能输入中文、英文、数字、英文句点'];
      break;
    case 6:
      ruleA = ['^(?=[0-9a-zA-Z\u4e00-\u9fa5._]+$)', '只能输入中英文、数字、下划线、英文句点'];
      break;
    case 7:
      ruleA = ['^[a-zA-Z._]+$', '只能输入英文字符、下划线、英文句号'];
      break;
    case 8:
      ruleA = ['^[A-F0-9]{2}(-[A-F0-9]{2}){5}$', '请输入正确的MAC地址'];
      break;
    case 9:
      ruleA = [
        '^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$',
        '请输入正确的邮箱地址',
      ];
      break;
    case 10:
      ruleA = [
        '(^[1-9][0-9]{0,3}$)|(^[1-5][0-9]{4}$)|(^6[0-4][0-9]{3}$)|(^65[0-4][0-9]{2}$)|(^655[0-2][0-9]$)|(^6553[0-5]$)',
        '端口号范围：1-65535',
      ];
      break;
    case 11:
      ruleA = ['^[a-z0-9A-Z\u4e00-\u9fa5]+$', '只能输入中文、英文、数字'];
      break;
    case 12:
      ruleA = ['[^ ]+', '不能全部为空格'];
      break;
    case 13:
      ruleA = ['^[a-z0-9A-Z]+$', '只能输入英文和数字。'];
      break;
  }
  return ruleA;
}
